<#import "/crud/macro/global.ftl" as crud>

<#assign basePath = crud.beginPath in crud />
<#assign list = page.resultList />

<#assign ext_js_list = ['flexigrid.js'] in crud />
<#assign ext_css_list = ['flexigrid.css'] in crud />
<#assign datagrid = 'flexme' in crud />

<@crud.body title=locale.title_prefix?if_exists + "--" + locale.list_in_page_title?if_exists>

<div class="crud_list_div">
<b>${locale.record_in_one?if_exists}</b>
<div class="flexigrid">
<table id="flexme">
	<thead>
    		<tr>
    		<#list list as row>
    		<#list row.fields as field>
    			<th width="150" title="Type:${field.type?if_exists}/${field.restrict?if_exists}">${field.name?if_exists}</th>
			</#list>
			<#break>
			</#list>
				<th width="100"></th>
            </tr>
    </thead>
    <tbody>
    	<#list list as row>
    		<tr>
    		<#assign querySuffix = "&" />
    		<#list row.fields as field>
    			<#assign querySuffix = querySuffix + "field_" + field.name + "=" + field.value + "&" />
    			<td>${field.value?if_exists}</td>
			</#list>
			
			<td>
			<#if (row.mod > 2)>
				<a href="${crud.crudUrl}?model=${model_crud_url?if_exists}&opt=viewone${querySuffix}" class="list_opt_but_a" title="">${locale.edit_label?if_exists}</a>
			</#if><#if (row.mod > 4)>
				<a href="${crud.crudUrl}?model=${model_crud_url?if_exists}&opt=deletepost${querySuffix}" class="list_opt_but_a" title="" onclick="return confirm('${locale.delete_warning_label?if_exists}');">${locale.delete_label?if_exists}</a>
            </#if>
            </td>
            </tr>
        </#list>
    </tbody>
</table>
</div>
</div>
	<@crud.pagination/>
</@crud.body>